package com.eden.websocket.domain;

import com.eden.common.annotation.Excel;
import com.eden.common.core.domain.BaseEntity;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * 消息对象 message
 *
 * @author eden
 * @date 2020-12-21
 */
public class Message extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 消息id,自增长
     */
    private Integer msgId;

    /**
     * 类型 1：文字；2：图片;3：音频；4：文件；5位置；
     */
    @Excel(name = "类型 1：文字；2：图片;3：音频；4：文件；5位置；")
    private Integer msgType;

    /**
     * 消息接收人登录名称
     */
    @Excel(name = "消息接收人登录名称")
    private String toUserLoginName;

    /**
     * 消息接收人名称
     */
    @Excel(name = "消息接收人名称")
    private String toUserName;

    /**
     * 消息格式【发信人ID：内容】
     */
    @Excel(name = "消息格式【发信人ID：内容】")
    private String content;

    /**
     * 发送者头像地址
     */
    @Excel(name = "发送者头像地址")
    private String fromAvatar;
    /**
     * 消息发送人登录名称
     */
    @Excel(name = "消息发送人登录名称")
    private String fromUserLoginName;

    /**
     * 消息发送人名称
     */
    @Excel(name = "消息发送人名称")
    private String fromUserName;
    /**
     * 是否是自己发送 0是 1不是
     */
    private Integer type;
    /**
     * 消息状态：0：未读；1：已读
     */
    @Excel(name = "消息状态：0：未读；1：已读")
    private Integer msgStatus;

    public Integer getType() {
        return type;
    }

    /**
     * 录音时长
     */
    @Excel(name = "录音时长")
    private Long voiceTime;

    public Long getVoiceTime() {
        return voiceTime;
    }

    public void setVoiceTime(Long voiceTime) {
        this.voiceTime = voiceTime;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public void setMsgId(Integer msgId) {
        this.msgId = msgId;
    }

    public void setFromAvatar(String fromAvatar) {
        this.fromAvatar = fromAvatar;
    }

    public String getFromAvatar() {
        return fromAvatar;
    }

    public Integer getMsgId() {
        return msgId;
    }

    public void setMsgType(Integer msgType) {
        this.msgType = msgType;
    }

    public Integer getMsgType() {
        return msgType;
    }

    public void setToUserLoginName(String toUserLoginName) {
        this.toUserLoginName = toUserLoginName;
    }

    public String getToUserLoginName() {
        return toUserLoginName;
    }

    public void setToUserName(String toUserName) {
        this.toUserName = toUserName;
    }

    public String getToUserName() {
        return toUserName;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getContent() {
        return content;
    }

    public void setFromUserLoginName(String fromUserLoginName) {
        this.fromUserLoginName = fromUserLoginName;
    }

    public String getFromUserLoginName() {
        return fromUserLoginName;
    }

    public void setFromUserName(String fromUserName) {
        this.fromUserName = fromUserName;
    }

    public String getFromUserName() {
        return fromUserName;
    }

    public void setMsgStatus(Integer msgStatus) {
        this.msgStatus = msgStatus;
    }

    public Integer getMsgStatus() {
        return msgStatus;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("msgId", getMsgId())
                .append("msgType", getMsgType())
                .append("toUserLoginName", getToUserLoginName())
                .append("toUserName", getToUserName())
                .append("createTime", getCreateTime())
                .append("content", getContent())
                .append("fromUserLoginName", getFromUserLoginName())
                .append("fromAvatar", getFromAvatar())
                .append("fromUserName", getFromUserName())
                .append("msgStatus", getMsgStatus())
                .append("voiceTime", getVoiceTime())
                .toString();
    }
}